<%--
  Created by IntelliJ IDEA.
  User: luhan
  Date: 5/29/2019
  Time: 2:15 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>My Shop | Homepage</title>
    <jsp:include page="/includes/header.jsp"/>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <jsp:include page="includes/mainHeader.jsp"/>

    <jsp:include page="includes/mainSideBar.jsp"/>


    <div class="content-wrapper" style="min-height: 902px;">
        <section class="content">
            <div class="row">
                <div class="box box-info">
                    <div class="box-header with-border text-center">
                        <h3 class="box-title">${user != null ? "Modify User" : "Register User"}</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal" action=${user != null ? "/modifyUser" : "/addUser"} method="post">
                        <div class="box-body">
                            <div class="form-group" hidden>
                                <label for="inputId" class="col-sm-2 control-label">Id</label>

                                <div class="col-sm-10">
                                    <input type="text" name="id" class="form-control" id="inputId" placeholder="Username" value="${user.id}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputUsername" class="col-sm-2 control-label">Username</label>

                                <div class="col-sm-10">
                                    <input type="text" name="username" class="form-control" id="inputUsername" placeholder="Username" value="${user.username}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">Email</label>

                                <div class="col-sm-10">
                                    <input type="email" name="email" class="form-control" id="inputEmail3" placeholder="Email" value="${user.email}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">Password</label>

                                <div class="col-sm-10">
                                    <input type="password" name="password" class="form-control" id="inputPassword3"
                                           placeholder="Password" value="${user.password}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPhone" class="col-sm-2 control-label">Phone</label>

                                <div class="col-sm-10">
                                    <input type="text" name="phone" class="form-control" id="inputPhone" placeholder="Phone" value="${user.phone}">
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <button type="button" class="btn btn-default" onclick="history.go(-1)">Cancel</button>
                            <button type="submit" class="btn btn-info pull-right">${user != null ? "Submit" : "Register User"}</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </section>


    </div>


    <jsp:include page="includes/footer.jsp"/>
</div>

<jsp:include page="includes/importFiles.jsp"/>
</body>
</html>